package com.yxw.live_vod_backend_boot.controller;

import com.yxw.live_vod_backend_boot.service.UserBackendService;
import com.yxw.live_vod_facade.dto.PageUserListDto;
import com.yxw.live_vod_facade.vo.UserInfoVo;
import com.yxw.yxnet_cd_center.common.dto.PageVO;
import com.yxw.yxnet_cd_center.common.utils.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户管理 Controller控制层
 *
 * @author xiexuxin
 * @date 2023-12-04
 */
@RestController
@Api(value = "用户管理", tags = "用户管理")
@Slf4j
@RequestMapping("/api/backend/user")
public class UserBackendController {

    @Autowired
    private UserBackendService userBackendService;

    @PostMapping(value = "pageUserList")
    @ApiOperation(value = "人员查询公用组件")
    public BaseResult<PageVO<UserInfoVo>> pageUserList(@RequestBody PageUserListDto dto){
        return userBackendService.pageUserList(dto);
    }

    @PostMapping(value = "/getUserList")
    @ApiOperation(value = "获取人员列表")
    public BaseResult<List<UserInfoVo>> getUserList(){
        return userBackendService.getUserList();
    }

    @PostMapping(value = "getUserInfo")
    @ApiOperation(value = "获取用户信息详情")
    public BaseResult getUserInfo(@RequestParam("userId") Long userId){
         return userBackendService.getUserInfo(userId);
    }
}
